package com.szh.cloud.api.classs.service.impl;

import com.szh.cloud.api.classs.entity.ClassEntity;
import com.szh.cloud.api.classs.entity.SearClassEntity;
import com.szh.cloud.api.classs.repository.ApiClassDao;
import com.szh.cloud.api.classs.service.ApiClassService;
import com.szh.cloud.api.classs.entity.ClassEntity;
import com.szh.cloud.api.classs.entity.SearClassEntity;
import com.szh.cloud.api.classs.repository.ApiClassDao;
import com.szh.cloud.api.classs.service.ApiClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;

@Service
public class ApiClassServiceIml implements ApiClassService {
    
    @Autowired
    private ApiClassDao apiClassDao;
    
    @Override
    public List<ClassEntity> queryClassListByPage(SearClassEntity entity) {
        return apiClassDao.queryClassListByPage(entity);
    }
    
    @Override
    public Integer queryClassListTotal(SearClassEntity entity) {
        return apiClassDao.queryClassListTotal(entity);
    }
    
    @Override
    public void addClass(ClassEntity entity) {
        entity.setCreateTime(new Date());
        entity.setUpdateTime(new Date());
        entity.setIsActive(1);
        apiClassDao.addClass(entity);
    }
    
    @Override
    public void updateClass(ClassEntity entity) {
        entity.setUpdateTime(new Date());
        apiClassDao.updateClass(entity);
    }
    
    @Override
    public void deleteClass(List<Integer> ids) {
        apiClassDao.deleteClass(ids);
    }
}
